package com.honghu.paylibrary.utils;

import android.util.Log;


import com.honghu.paylibrary.BuildConfig;

import java.util.Calendar;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

/**
 * 创建日期 2019/11/20
 * 描述：链接
 */
public class UrlHelp {

    public static final String CODE = "code";
    public static final String MSG = "msg";
    public static final String DATA = "data";
    public static final String SUB_CODE = "subCode";
    public static final String SUB_MSG = "subMsg";
    private static final String API = "/api";
    private static String BSSE_URL;

    public static String getBsseUrl() {
        return BSSE_URL == null ? "" : BSSE_URL;
    }

    public static void setBsseUrl(String bsseUrl) {
        BSSE_URL = bsseUrl;
    }

    public static String getAppSign(Map<String, Object> map, Set<String> set){
        Iterator<String> iterator = set.iterator();
        StringBuffer stringBuffer = new StringBuffer();
        while (iterator.hasNext()){
            String key = iterator.next();
            stringBuffer.append(key);
            stringBuffer.append("=");
            String value = map.get(key).toString();
            stringBuffer.append(value);
            stringBuffer.append("&");
        }
        stringBuffer.append(BuildConfig.appSign);
        return MD5Util.encode(stringBuffer.toString());
    }

    public class Pay{

        private static final String key="/pay";
        public static final String zfb_h5=key+"/zfb/h5/"+BuildConfig.Ali_pay_url_v;
        public static final String yl_sdk=key+"/yl/sdk/v1";
        public static final String wx_sdk=key+"/wechat/cashier/v1";
    }
    public static String getTimeStamp(){
        return System.currentTimeMillis()+"";
    }

}
